<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>好看的区块盒子</title>
    <style>
        .blockBox{
            display: flex;
            height: 100px;
            border-radius: 5px 0 0 5px;
            overflow: hidden;
            /*background-color: rgb(236,248,255);*/
        }
        .blockBox .bb_style{
            height: 100%;
            width: 5px;
            /*background-color: rgb(80,191,255);*/
        }
        .blockBox .bb_con{
            flex: 1;
            box-sizing: border-box;
            padding: 15px;
        }
    </style>
</head>
<body>
    <div class="blockBox" ovo-type="blue">
        <div class="bb_style"></div>
        <div class="bb_con">
            123456
        </div>
    </div>

    <script>
        let blockBox = document.getElementsByClassName('blockBox');

        var blockBoxArr = [].slice.call(blockBox);

        blockBoxArr.forEach(function(v,i){
            var ovoType = v.getAttribute('ovo-type');
            if(ovoType == 'blue'){
                console.log(v);
                v.style.cssText = 'background-color:rgb(236,248,255)';
                v.children[0].style.cssText = 'background-color:rgb(80,191,255)';
            }
        })
    </script>
</body>
</html>